﻿
using System;
using System.Xml.Linq;

namespace SvGame.Objects;

public partial class Npc : IRole
{
    [Desc("战斗数据")]
    [JsonIgnore]
    public CombatData Comb = new();


    long IRole.Uid => Uid;
    string IRole.Name => Cfg.SettBase.Name;
    EGender IRole.Gender => (EGender)Cfg.SettBase.Gender;
    public string Unit => "位";
    EClasss IRole.Classs => (EClasss)Cfg.SettBase.Classs;
    ERace IRole.Race => (ERace)Cfg.SettBase.Race;
    int IRole.Age => Age;
    string IRole.Family => Cfg.SettBase.Family;
    string IRole.Guild => "无帮派";

    CombatData IRole.Comb => Comb;

    public bool IsBusy => Comb.BusyIn();
    public void BusyStart(int ms, bool busynew = true) => Comb.BusyStart(ms, busynew);
    public bool IsCd(string perform) => Comb.IsCd(perform);
    public void CdStart(string perform, int sec) => Comb.CdStart(perform, sec);


    [Desc("房间")]
    [JsonIgnore]
    public Room Room { get; set; } = null;

    public string DebugName => $"[{Uid}]{Cfg.SettBase.Name}";

}
